﻿using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using AcAp = Autodesk.AutoCAD.ApplicationServices.Application;

namespace haimian
{

    public class Commands
    {
        // static field
        static CustomPaletteSet palette;
        // static field
        static CalloutPaletteSet calloutPalette;

        [CommandMethod("HAI")]
        public void ShowHaiPaletteSetWpf()
        {
            Document doc = AcAp.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            if (palette == null)
                palette = new CustomPaletteSet();
            palette.Visible = true;
            ed.WriteMessage("硕佰海绵城市表格标注插件已加载成功~\n");
        }


        [CommandMethod("SHU")]
        public void ShowCalloutPaletteSetWpf()
        {
            Document doc = AcAp.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            if (calloutPalette == null)
                calloutPalette = new CalloutPaletteSet();
            calloutPalette.Visible = true;
            ed.WriteMessage("硕佰海绵城市批量统计插件已加载成功~\n");
        }

    }
}
